% Name: tws.m
% Created 03/02/2012
% Crown Copyright
%
% Description: creates a sectioned image using three input matrices which
% correspond to structured illumination with 2*pi/3 phase shifts between
% them
%               
% @author Kevin O'Holleran <kevin.o-holleran@npl.co.uk>
%
% @param i1 matrix of illumination
% @param i2 matrix of same illumination with 2*pi/3 phase shift
% @param i3 matrix of same illumination with 4*pi/3 phase shift
function [ tws ] = grating(i1,i2,i3)
    i1 = double(i1);
    i2 = double(i2);
    i3 = double(i3);
    tws = sqrt((i1-i2).^2+(i1-i3).^2+(i2-i3).^2)/sqrt(2);
end

